-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Octicon SVG spritemap #10107
Add Octicon SVG spritemap #10107
Conversation
Signed-off-by: jolheiser <[email protected]>
|
This PR needs much more work before I look for approvals (sorry, just noticed I never marked as draft or WIP) Currently I'm just gathering feedback on whether this seems like an acceptable solution. 😄 |
Interestingly, it's not picked up because of the build tag. 🤔 EDIT: Unless you were talking about the CI failure. 😅 |
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some comments at the top of the script file with instructions on how to update the icons? I'm guessing it's like:
- Choose a new version of the library; update
go.mod
accordingly. make vendor
to bring it up to date.- Run the script with (insert exact
go run
command here). git add
, commit...
Github does publish a npm module for octicons at https://www.npmjs.com/package/@primer/octicons. You could |
@silverwind I was going to do that, but they don't publish a sprite, so we would need to still make one somehow, or use them individually. While I'm sure it's possible, someone more experienced with JS would likely need to do it. |
Yet another alternative is to forego the script altogether and manually stitch together a sprite whenever we want to update. |
The output file could be optimized further with tools like https://github.com/svg/svgo. I guess a As for spritesheeting, I have used https://github.com/svgstore/svgstore in the past, but there are probably better tools around. |
@silverwind I am using https://github.com/jkphl/svg-sprite, which apparently uses I will commit my changes once I have finished swapping out icons so that people can review. 😃 |
@jolheiser ok. I see |
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
I think this is more or less ready for review. I will definitely need feedback on the Makefile entry. I didn't include it in the And of course Drone is mad about PhantomJS, though I am unsure how exactly to resolve that... |
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
That last one seems to have fixed it. 🎉 |
Co-Authored-By: silverwind <[email protected]>
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
I think you still need to add a entry for |
Signed-off-by: jolheiser <[email protected]>
@silverwind Done with both. I didn't add the |
One more related improvement that might be good to have is a preload entry for it, e.g. <link rel="preload" as="image" href="{{StaticUrlPrefix}}/img/svg/icons.svg"> |
Signed-off-by: jolheiser <[email protected]>
@silverwind Done. |
Any more reviews here? I'm very excited to get SVG icons in personally 😉 |
Ping lgtm |
To Do: